pub fn convert_base(num_str: &str, to_base: u32) -> String {
    /*let parts = num_str.trim().split(['(', ')']).collect::<Vec<&str>>();
    let value = parts[0];
    let base = parts[1].parse::<u32>().unwrap();

    let mut former = i64::from_str_radix(value, base).unwrap();
    let mut result = String::new();
    while former > 0 {
        let remainder = (former % to_base as i64) as u32;
        let num = if remainder < 10 {
            (remainder as u8 + b'0') as char
        } else {
            (remainder as u8 - 10 + b'A') as char
        };
        result.push(num);
        former /= to_base as i64;
    }
    if result.is_empty() {
        result.push('0');
    }
    result.chars().rev().collect::<String>()*/
    assert!(to_base >= 2 && to_base <= 16);
    let (num_str, from_base) = num_str.split_once("(").unwrap();
    let from_base = from_base.split_once(")").unwrap().0;
    let num = u32::from_str_radix(num_str, from_base.parse().unwrap()).unwrap();
    let mut result = String::new();
    let mut t = num;
    while t > 0 {
        let digit = t % to_base;
        let digit = if digit < 10 {
            (b'0' + digit as u8) as char
        } else {
            (b'a' + digit as u8 - 10) as char
        };
        result.push(digit);
        t /= to_base;
    }
    if result.is_empty() {
        result.push('0');
    }
    result.chars().rev().collect()
}
